package handler

import (
	"course/interal/dao"
	"course/interal/model"
	"github.com/gin-gonic/gin"
	"net/http"
)

func ListCourse(c *gin.Context) {
	var con []model.Courses
	dao.GetListByField(&model.Courses{}, &con)
	var cons []*model.Courses
	for _, v := range con {
		cons = append(cons, &v)
	}
	c.JSON(http.StatusOK, gin.H{
		"code": http.StatusOK,
		"msg":  "ok",
		"data": cons,
	})
}
